#ifndef _XMESH_TRIANGLE_MESH_H
#define _XMESH_TRIANGLE_MESH_H

#include "mesh_traits.h"


template <typename Value>
class TriMeshVertex : public Vertex<Value>
{

protected :
	typedef Vertex<Value> DefaultVertexType ;
	typedef typename VertexTraits<DefaultVertexType>::ValueType    ValueType; 
	typedef typename VertexTraits<DefaultVertexType>::FaceType     FaceType;
	typedef typename VertexTraits<DefaultVertexType>::VertexType   VertexType;
	typedef typename VertexTraits<DefaultVertexType>::HalfEdgeType HalfEdgeType ; 
	typedef typename VertexTraits<DefaultVertexType>::EdgeType     EdgeType ; 
	typedef typename VertexTraits<DefaultVertexType>::VectorType   VectorType ;
	typedef typename VertexTraits<DefaultVertexType>::PointType    PointType ;
	typedef typename VertexType::VVIter VVIter ;

public :
    /**
	 * Calculate the area of local averaging region. 
	 */
	const ValueType get_local_area ()  const 
	{
		ValueType area = ValueType(0);
		PointType center (ValueType(0), ValueType(0), ValueType(0));
		unsigned count = 0; 


		for (VVIter iter = TriMeshVertex<ValueType>::vv_begin(); iter != TriMeshVertex::vv_end(); ++iter)
		{
			//Fix me later. I will define a new class Polygon. 
			center += iter->m_coord ;
			++count ;
		}
		center /= ValueType(count); 
		

		
		return this->m_local_area ; 
	}
	void hello ()
	{
	}
private :
	ValueType m_local_area ;
};

template <typename Value>
struct TriMeshTraits  : public MeshTraits<Value>
{

};

template <typename TriMeshTraits>
class TriMesh : public Mesh <TriMeshTraits>
{
public :
	TriMesh () {}
	virtual ~ TriMesh() {}

private :

};


#endif
